package com.example.consumer.service.impl;

import com.example.consumer.service.IdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author : 林顺
 * @date : 2022/8/10
 */
@Service
public class IdServiceImpl implements IdService {

    @Override
    public String addId() {
        ReentrantLock reentrantLock  = new ReentrantLock();
        AtomicInteger atomicInteger = new AtomicInteger(1);
        atomicInteger.compareAndSet(1,2);
        return null;
    }

}
